//
//  DepartModifyViewController.m
//  Marketing
//
//  Created by wmm on 16/3/13.
//  Copyright © 2016年 Hanen 3G 01. All rights reserved.
//

#import "DepartModifyViewController.h"
#import "SelectViewController.h"
#import "SelectPersonView.h"
#import "DepartmentModel.h"
#import "UserModel.h"

#import "SelectPersonViewController.h"

#define SEctionBackH 17.0f
@interface DepartModifyViewController ()<SelectStaffViewDelegate,SelectPersonViewDelegate,UITextFieldDelegate>{
    
    BOOL isClickManager;
      SelectPersonView * selectView;
    BOOL backRefresh;
    UIButton *selectBtn;
    UserModel *responModel;
    
}

@property (strong, nonatomic) UITextField *nameFld;
@property (strong, nonatomic) UITextField *managerFld;
@property (strong, nonatomic) NSMutableArray *staffArray;
@property (strong, nonatomic) UILabel *addStaffLabel;
@property (strong, nonatomic) UIButton *addUserBtn;
@property (strong, nonatomic) UIImageView *addUserImg;

@end

@implementation DepartModifyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.titleView = [ViewTool getNavigitionTitleLabel:@"部门设置"];
    self.navigationItem.leftBarButtonItem = [ViewTool getBarButtonItemWithTarget:self WithAction:@selector(popViewController)];
    
//    UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStyleBordered target:self action:@selector(clickToModDepartment)];
//    self.navigationItem.rightBarButtonItem = rightBarItem;
//    self.navigationItem.rightBarButtonItem=nil;
//    self.navigationItem.rightBarButtonItem.tintColor = [UIColor whiteColor];
    self.view.backgroundColor = graySectionColor;
    
    self.navigationItem.rightBarButtonItem.tintColor = mainOrangeColor;
//    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
//    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    btn.titleLabel.font = [UIFont systemFontOfSize:16.0f];
//    [btn setTitle:@"完成" forState:UIControlStateNormal];
//    UIBarButtonItem *bar = [[UIBarButtonItem alloc] initWithCustomView:btn];
//    self.navigationItem.rightBarButtonItem = bar;
   // clickToModDepartment
   
    
    _staffArray = [NSMutableArray array];
    [self createUI];
    //    [self initData];
}

- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBarHidden = NO;
    self.tabBarController.hidesBottomBarWhenPushed = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    self.tabBarController.hidesBottomBarWhenPushed = NO;
}

- (void)popViewController
{
    [_staffArray removeAllObjects];
    [self.navigationController popViewControllerAnimated:YES];
}

//- (void)clickToModDepartment{
//    NSMutableString *alluserIds = [[NSMutableString alloc] init];
//    for (int i = 0; i< selectView.allPersonArray.count; i ++) {
//        UserModel * model = selectView.allPersonArray[i];
//        NSLog(@"%@,%d",model.name,model.uid);
//        NSString *str = [NSString stringWithFormat:@"%d,",model.uid];
//        NSLog(@"model.uid  %d",model.uid);
//        [alluserIds appendString:str];
//        NSLog(@"%@",str);
//    }
//    NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:@(UID), @"uid", TOKEN, @"token", @(_depart.departId), @"id",  @(_managerFld.tag), @"muid", alluserIds, @"ids", nil];
//    NSLog(@"%@",params);
//    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
//    manager.requestSerializer.timeoutInterval = 20;
//    [manager POST:UPDATE_DEPARTMENT_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
//        NSLog(@"UPDATE_DEPARTMENT_URL:%@",responseObject);
//        int code = [[(NSDictionary *)responseObject objectForKey:@"code"] intValue];
//        if(code != 100)
//        {
//            NSString * message = [(NSDictionary *)responseObject objectForKey:@"message"];
//            [self.view makeToast:message];
//        }else{
//            self.blcok(YES,);
//            [self.view makeToast:@"修改成功"];
//        }
//        [self popViewController];
//    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        NSLog(@"%@",error);
//    }];
//    
//}

- (void)createUI{
    
    UIView * view1 = [ViewTool getLineViewWith:CGRectMake(0, 0, KSCreenW, 70.0f) withBackgroudColor:[UIColor whiteColor]];
    [self.view addSubview:view1];
    
    UIView *topGray = [ViewTool getLineViewWith:CGRectMake(0, 0, KSCreenW, SEctionBackH) withBackgroudColor:graySectionColor];
    topGray.layer.borderColor = grayLineColor.CGColor;
    topGray.layer.borderWidth = 1.0f;
    [view1 addSubview:topGray];
    
    UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake([UIView getWidth:10.0f], topGray.maxY, 80.0f, 43.0f)];
    nameLabel.text = @"部门名称";
    nameLabel.textColor = grayFontColor;
    nameLabel.font = [UIFont systemFontOfSize:16];
    [view1 addSubview:nameLabel];
    
    
    _nameFld = [[UITextField alloc]initWithFrame:CGRectMake(nameLabel.maxX + 10, nameLabel.y + 5, KSCreenW - 20 - nameLabel.maxX, 30.0f)];
//    _nameFld.placeholder = @"请输入部门名称";
    _nameFld.text = _depart.name;
    _nameFld.textColor = blackFontColor;
//    _nameFld.backgroundColor = NavBackColor;
    _nameFld.font = [UIFont systemFontOfSize:16];
    _nameFld.delegate = self;
//    _nameFld.userInteractionEnabled = NO;
    [view1 addSubview:_nameFld];
    
    UILabel *lineLab = [[UILabel alloc] initWithFrame:CGRectMake(nameLabel.x, nameLabel.maxY ,KSCreenW - nameLabel.x, 1)];
    lineLab.layer.borderWidth = 1;
    lineLab.layer.borderColor = [grayLineColor CGColor];
    [view1 addSubview:lineLab];
    
    UILabel *managedUserLabel = [[UILabel alloc]initWithFrame:CGRectMake([UIView getWidth:10.0f], lineLab.maxY , 80.0f, 43.0f)];
    managedUserLabel.text = @"部门负责人";
    managedUserLabel.textColor = grayFontColor;
    managedUserLabel.font = [UIFont systemFontOfSize:16];
    [view1 addSubview:managedUserLabel];
    
    _managerFld = [[UITextField alloc]initWithFrame:CGRectMake(managedUserLabel.maxX + 10, managedUserLabel.y + 5, _nameFld.width, 30.0f)];
//    _managerFld.backgroundColor = NavBackColor;
    //    _managerFld.placeholder = @"请选择负责人";
    
    _managerFld.text = _depart.cname;
    _managerFld.tag = _depart.mid;
  
    _managerFld.textColor = blackFontColor;
    _managerFld.font = [UIFont systemFontOfSize:16];
    _managerFld.userInteractionEnabled = NO;
    [view1 addSubview:_managerFld];
    
    UIButton *managedUserBtn = [[UIButton alloc]initWithFrame:CGRectMake(managedUserLabel.maxX + 10, managedUserLabel.y + 5, _nameFld.width, 30.0f)];
    managedUserBtn.tag = 0;
//    managedUserBtn.backgroundColor = NavBackColor;
    [managedUserBtn addTarget:self action:@selector(openStaffView) forControlEvents:UIControlEventTouchUpInside];
    [view1 addSubview:managedUserBtn];
    
    
    UIView *sectionView = [[UIView alloc] initWithFrame:CGRectMake(0, _managerFld.maxY+10, self.view.width, [UIView getHeight:20])];
    sectionView.layer.borderWidth = 1;
    sectionView.layer.borderColor = [grayLineColor CGColor];
    sectionView.backgroundColor = graySectionColor;
    [view1 addSubview:sectionView];
    
    view1.frame = CGRectMake(0, 0, KSCreenW, sectionView.maxY);
    
    
    UIView * addView = [ViewTool getLineViewWith:CGRectMake(0, view1.maxY, KSCreenW, [UIView getWidth:60.0f]) withBackgroudColor:[UIColor whiteColor]];
    [self.view addSubview:addView];
    
    
    _addStaffLabel = [[UILabel alloc]initWithFrame:CGRectMake([UIView getWidth:10.0f], 0, 80.0f, addView.height)];
    _addStaffLabel.text = @"添加人员";
    _addStaffLabel.textColor = grayFontColor;
    _addStaffLabel.font = [UIFont systemFontOfSize:16];
    [addView addSubview:_addStaffLabel];
    
//        _addUserImg = [[UIImageView alloc]initWithFrame:CGRectMake(20, _addStaffLabel.maxY+10, [UIView getHeight:30], [UIView getHeight:30])];
//        _addUserImg.image = [UIImage imageNamed:@"添加人员"];
//        _addUserImg.userInteractionEnabled = YES;
//        UIGestureRecognizer *singleTap = [[UIGestureRecognizer alloc]initWithTarget:self action:@selector(openStaffView)];
//        [_addUserImg addGestureRecognizer:singleTap];
//    
//        [self.view addSubview:_addUserImg];
    
//    _addUserBtn = [[UIButton alloc]initWithFrame:CGRectMake(20, _addStaffLabel.maxY+10, [UIView getHeight:30], [UIView getHeight:30])];
//    [_addUserBtn setBackgroundImage:[UIImage imageNamed:@"添加人员"] forState:UIControlStateNormal];
//    //    _addUserBtn.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"添加人员"]];
//    _addUserBtn.tag = 1;
//    [_addUserBtn addTarget:self action:@selector(openStaffView:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:_addUserBtn];
//
    selectView = [[SelectPersonView alloc] initWithFrame:CGRectMake(_addStaffLabel.maxX + 20.0f, [UIView getWidth:5.0f], KSCreenW - 3 * 10 - _addStaffLabel.maxX, addView.height - [UIView getWidth:10.0f])];
    selectView.backgroundColor = [UIColor clearColor];
    selectView.personArray = self.departMansArray;
//    selectView.backgroundColor = NavBackColor;
    selectView.target = self;
    selectView.delegate = self;
    __unsafe_unretained DepartModifyViewController *deapVC = self;
    selectView.block = ^(BOOL refresh){
        deapVC.blcok(refresh,deapVC.nameFld.text,deapVC.managerFld.text,(int)deapVC.managerFld.tag,deapVC.depart);
    };
    
    [addView addSubview:selectView];
    
    UILabel *lineLab2 = [[UILabel alloc] initWithFrame:CGRectMake(0, addView.height - 1, KSCreenW, 1)];
    lineLab2.backgroundColor = grayLineColor;
//    lineLab2.layer.borderWidth = 1;
//    lineLab2.layer.borderColor = [grayListColor CGColor];
    [addView addSubview:lineLab2];
 
    
    
    [self addBootomBtn];
    
//    UIButton *selectBtn = [UIButton buttonWithType:UIButtonTypeSystem];
//    [selectBtn setTitle:NSLocalizedString(@"删除部门", nil) forState:UIControlStateNormal];
//    [selectBtn setTitleColor:mainOrangeColor forState:UIControlStateNormal];
//    [selectBtn.titleLabel setFont:[UIView getFontWithSize:15.0f]];
//    selectBtn.frame = CGRectMake(0, KSCreenH-TabbarH, self.view.width, TabbarH);
//    [selectBtn addTarget:self action:@selector(clickToDelDepart) forControlEvents:UIControlEventTouchUpInside];
//    
//    [self.view addSubview:selectBtn];
    
}

- (void)addBootomBtn
{
//    CGFloat space = [UIView getWidth: 10.0f];
    
    UIView *postView = [ViewTool getLineViewWith:CGRectMake(0, KSCreenH - 70 - 64, KSCreenW, 70) withBackgroudColor:[UIColor whiteColor]];
    [self.view addSubview:postView];
    
    selectBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 9, postView.width - 20, postView.height - 16)];
//    selectBtn.layer.cornerRadius = 4.0f;
//    selectBtn.layer.masksToBounds = YES;
//    selectBtn.layer.shouldRasterize = YES;
    
    [selectBtn addTarget:self action:@selector(clickToDelDepart:) forControlEvents:UIControlEventTouchUpInside];
//    selectBtn.backgroundColor = redBackColor;
    [selectBtn setBackgroundImage:[UIImage imageNamed:@"HY_btn_red_normal"] forState:UIControlStateNormal];
    [selectBtn setBackgroundImage:[UIImage imageNamed:@"HY_btn_red_press"] forState:UIControlStateSelected];
    [selectBtn setTitle:@"删除部门" forState:UIControlStateNormal];
    [selectBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [postView addSubview:selectBtn];
    
    UIView *line3 = [ViewTool getLineViewWith:CGRectMake(0, 0, KSCreenW, 1) withBackgroudColor:grayLineColor];
    [postView addSubview:line3];

}
//SelectStaffViewDelegate
- (void)getSelectedStaff:(NSArray *)array{
    
    NSLog(@"返回的人数%ld",array.count);
    if(isClickManager){
        if (array.count > 1) {
            [self.view makeToast:@"请选择一个部门负责人"];
        }else{
            UserModel *model = array[0];
            _managerFld.text = model.name;
            _managerFld.tag = model.uid;
            _depart.mid = model.uid;
            responModel = model;
            [_staffArray addObject:[NSString stringWithFormat:@"%d",model.uid]];
            
             NSLog(@"fuz23erde id %ld",_managerFld.tag);
//            if (self.navigationItem.rightBarButtonItem == nil) {
//                UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStyleBordered target:self action:@selector(clickToModDepartment)];
//                rightBarItem.tintColor = [UIColor whiteColor];
//                self.navigationItem.rightBarButtonItem = rightBarItem;
//            }
            
             [selectBtn setTitle:@"保存" forState:UIControlStateNormal];
        }
    }else{
    
//            if (self.navigationItem.rightBarButtonItem == nil) {
//                UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStyleBordered target:self action:@selector(clickToModDepartment)];
//                rightBarItem.tintColor = [UIColor whiteColor];
//                self.navigationItem.rightBarButtonItem = rightBarItem;
                [selectBtn setTitle:@"保存" forState:UIControlStateNormal];
//            }
        
        NSMutableArray *arr = [NSMutableArray array];
        if(selectView.allPersonArray.count != 0){
            //    for (int i = 0; i < selectView.allPersonArray.count; i++) {
            //        UserModel *model = selectView.allPersonArray[i];
            //        [arr addObject:model];
            //    }
            NSArray *arrsdf = selectView.allPersonArray;
            
            NSMutableArray *uidArr = [NSMutableArray array];
            
            for (int i = 0; i<arrsdf.count; i++) {
                UserModel *model = arrsdf[i];
                [uidArr addObject:@(model.uid)];
            }
            //        NSLog(@"数组个数%ld",arrsdf.count);
            for (int i = 0; i < array.count; i++) {
                UserModel *model1 = array[i];
                //            NSLog(@"%@",model1.name);
                
                if (![uidArr containsObject:@(model1.uid)]) {
                    [arr addObject:model1];
                }else{
                    continue;
                }
            }
            //          NSLog(@"返回的数组人数%lu",(unsigned long)arr.count);
        }else{
            arr = (NSMutableArray *)array;
        }

            selectView.personArray = arr;
           
            
        
        
        //        [_addUserBtn setFrame:CGRectMake(20, _addStaffLabel.maxY+10, [UIView getHeight:20], [UIView getHeight:20])];
    }
}
- (void)addPerson
{
    isClickManager = NO;
//    SelectViewController *selectViewController = [[SelectViewController alloc]init];
//    self.modalPresentationStyle =  UIModalPresentationPageSheet;
//    
//    selectViewController.delegate = self;
//    
//    [self.navigationController pushViewController:selectViewController animated:YES];
//    UIImage *image;
//    @autoreleasepool {
//        image = [ViewTool ScreenShotFromView:[[UIApplication sharedApplication] windows][0]];
//    }
    SelectPersonViewController * VC = [[SelectPersonViewController alloc] init];
    VC.isCreatDepartment = YES;
    self.modalPresentationStyle =  UIModalPresentationPageSheet;
//    VC.screenShot = image;
        VC.delegate = self;
    
        [self.navigationController pushViewController:VC animated:YES];

}
- (void)openStaffView{
     isClickManager = YES;
    SelectPersonViewController * VC = [[SelectPersonViewController alloc] init];
    self.modalPresentationStyle =  UIModalPresentationPageSheet;
    
    VC.delegate = self;
    
    [self.navigationController pushViewController:VC animated:YES];
}
//
//- (void)openStaffView2{
//    
//    SelectViewController *selectViewController = [[SelectViewController alloc]init];
//    self.modalPresentationStyle =  UIModalPresentationPageSheet;
//    isClickManager = YES;
//    selectViewController.delegate = self;
//    
//    [self presentViewController:selectViewController animated:YES completion:^{
//        selectViewController.view.superview.frame = CGRectMake(0, 0, KSCreenW, KSCreenH);
//    }];
//}

- (void)clickToDelDepart:(UIButton *)btn{
    if ([btn.currentTitle isEqualToString:@"保存"]) {
        NSMutableString *alluserIds = [[NSMutableString alloc] init];
        for (int i = 0; i< selectView.allPersonArray.count; i ++) {
            UserModel * model = selectView.allPersonArray[i];
            NSLog(@"%@,%d",model.name,model.uid);
            NSString *str = [NSString stringWithFormat:@"%d,",model.uid];
            NSLog(@"model.uid  %d",model.uid);
            [alluserIds appendString:str];
            NSLog(@"%@",str);
        }
        if(_nameFld.text.length == 0){
            [ViewTool showMessage:@"请填写部门名字" view:self];
            return;
        }
        NSLog(@"fuzerde id %ld",_managerFld.tag);
        NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:@(UID), @"uid", TOKEN, @"token", @(_depart.departId), @"id",  @(_managerFld.tag), @"mid", alluserIds, @"ids",_nameFld.text,@"name", nil];
        NSLog(@"params %@",params);
        AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
        manager.requestSerializer.timeoutInterval = 20;
        [manager POST:UPDATE_DEPARTMENT_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
            NSLog(@"UPDATE_DEPARTMENT_URL:%@",responseObject);
            int code = [[(NSDictionary *)responseObject objectForKey:@"code"] intValue];
            if(code != 100)
            {
                NSString * message = [(NSDictionary *)responseObject objectForKey:@"message"];
                [self.view makeToast:message];
            }else{
                _depart.name = _nameFld.text;
                _depart.cname =_managerFld.text;
                _depart.mid = responModel.uid;
                self.blcok(YES,self.nameFld.text,self.managerFld.text,(int)self.managerFld.tag,_depart);
                [self.view makeToast:@"修改成功"];
                [selectBtn setTitle:@"删除部门" forState:UIControlStateNormal];
            }
//            [self popViewController];
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            NSLog(@"%@",error);
        }];

    }else if ([btn.currentTitle isEqualToString:@"删除部门"]){
    NSString *str = [NSString stringWithFormat:@"是否删除%@",_depart.name];
    ZLAlertView *alert = [[ZLAlertView alloc] initWithTitle:@"提示" message:str];
    [alert addBtnTitle:@"是" action:^{
        NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:@(UID), @"uid", TOKEN, @"token", @(_depart.departId), @"id",  nil];
        AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
        NSLog(@"%@------------",params);
        manager.requestSerializer.timeoutInterval = 20;
        [manager POST:DELETE_DEPARTMENT_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"DELETE_DEPARTMENT_URL:%@",responseObject);
        NSLog(@"%@",responseObject);
        int code = [[(NSDictionary *)responseObject objectForKey:@"code"] intValue];
        if(code != 100)
            {
                NSString * message = [(NSDictionary *)responseObject objectForKey:@"message"];
                [self.view makeToast:message];
    
            }else{
                self.blcok(YES,_nameFld.text,_managerFld.text,(int)_managerFld.tag,_depart);
                [self.view makeToast:@"删除成功"];
            }
            

//            [[self navigationController] popViewControllerAnimated:YES];
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            NSLog(@"%@",error);
    }];
        UIViewController *viewCtl = self.navigationController.viewControllers[2];
        
        [self.navigationController popToViewController:viewCtl animated:YES];
    }];
    [alert addBtnTitle:@"否" action:^{
    
    }];

    [alert showAlertWithSender:self];

    }
//    NSString *str = [NSString stringWithFormat:@"是否删除%@",_depart.dname];
//    UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"提示" message:str preferredStyle:UIAlertControllerStyleActionSheet];
//    //添加Button
//    [alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//        
//        NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:@(UID), @"uid", TOKEN, @"token", @(_depart.departId), @"id",  nil];
//        AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
//        NSLog(@"%@------------",params);
//        manager.requestSerializer.timeoutInterval = 20;
//        [manager POST:DELETE_DEPARTMENT_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
//            NSLog(@"DELETE_DEPARTMENT_URL:%@",responseObject);
//            NSLog(@"%@",responseObject);
//            int code = [[(NSDictionary *)responseObject objectForKey:@"code"] intValue];
//            if(code != 100)
//            {
//                NSString * message = [(NSDictionary *)responseObject objectForKey:@"message"];
//                [self.view makeToast:message];
//                
//            }else{
//                [self.view makeToast:@"删除成功"];
//            }
////                    [self popViewController];
//            [[self navigationController] popViewControllerAnimated:YES];
//        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//            NSLog(@"%@",error);
//        }];
//        
//    }]];
//    [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
//    [self presentViewController:alertController animated:YES completion:nil];
    
}

- (void)clickToDelDepartUser{
    //    [_staffArray addObject:uidStr];
}

//关闭虚拟键盘。
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
    if (textField == _nameFld) {
       [selectBtn setTitle:@"保存" forState:UIControlStateNormal];
    }
}
- (void)textFieldDidEndEditing:(UITextField *)textField
{
    if(textField == _nameFld){
        if (textField.text == _depart.name) {
            
        }
    }
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [_nameFld resignFirstResponder];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
